package com.t18;

import java.io.IOException;
import java.io.StringReader;
import java.io.StringWriter;

/**
 * Created by xuyiwei on 2018/9/1.
 */
public class MemoryInput {
    public static void main(String[] args) throws IOException {
        StringWriter sw = new StringWriter();
        StringReader in = new StringReader(BufferedInputFile.read("/Users/xuyiwei/Documents/javaBase/jdk/src/com/t18/MemoryInput.java"));
        int c;
        while((c=in.read())!=-1){
            System.out.println((char)c);
            sw.write(c);
        }
        in.close();
        sw.close();
        System.out.println(sw.getBuffer().toString());


    }
}
